{extend name='admin@public/content'}
{block name="content"}
<form autocomplete="off" class="layui-form layui-box modal-form-box" action="{:request()->url()}" data-auto="true" method="post">

    <div class="layui-form-item">
        <label class="layui-form-label">单页名称</label>
        <div class="layui-input-block">
            <input type="text"  name="dname" value='{$vo.dname|default=""}' placeholder="请输入单页名称" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">单页调用代码</label>
        <div class="layui-input-block">
            {if $vo and isset($vo.dclock)}
            <input type="text" disabled="disabled" required="required" name="dclock" value='{$vo.dclock|default=""}'  title="请输入单页调用代码" placeholder="请输入单页调用代码" class="layui-input">
            {else /}
            <input type="text" name="dclock" value='{$vo.dclock|default=""}'  title="请输单页调用代码" placeholder="请输入单页调用代码" class="layui-input">
            {/if}
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">单页访问次数</label>
        <div class="layui-input-block">
            <input type="number"  name="code" value='{$vo.code|default=""}' placeholder="请输入单页访问次数" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">单页内容</label>
        <div class='col-sm-8'>
            <textarea name="value">{$vo.value|default=''|raw}</textarea>
        </div>
    </div>


    <div class="hr-line-dashed"></div>

    <div class="layui-form-item text-center">
        {if isset($vo['id'])}<input type='hidden' value='{$vo.id}' name='id'>{/if}
        <button class="layui-btn" type='submit'>保存数据</button>
        <button class="layui-btn layui-btn-danger" type='button' onclick="window.history.back()">取消编辑</button>
    </div>
    <script>window.form.render();</script>

    <script>
        /*! 实例富文本编辑器  */
        require(['ckeditor'], function () {
            window.createEditor('[name="value"]', {height: 500});
        });
    </script>
    <style>
        .background-item {
            padding: 15px;
            background: #efefef;
        }

        .background-item thead tr {
            background: #e0e0e0
        }
    </style>
</form>
{/block}
